package com.atguigu.cloud.config;

import feign.Logger;
import feign.Retryer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ClassName:    FeignConfig
 * Package:  com.atguigu.cloud.config
 * Description:
 *
 * @Author: interface
 * @Create: 2025/7/16 - 下午7:56
 * @Version: v1.0
 */
@Configuration
public class FeignConfig {

    @Bean
    public Retryer feignRetryer() {
        return Retryer.NEVER_RETRY; // Feign 默认 不走 重试机制
        //最大请求次数为 3 (1 +2 ),初始间隔时间 100ms, 重试期间最大间隔时间 1s
        //return new Retryer.Default(100, 1, 3);
    }

    @Bean
    Logger.Level feignLoggerLevel() {
        return Logger.Level.FULL;
    }
}
